<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			/**
			 * 根据分数获取 5级别制的分数
			 * 90-100 	A
			 * 80--89 	B
			 * 70-79  	C
			 * 60---69 	D 
			 * <60  	E
			 */
			var score = -95;


			//100  --  A B C D E
			// var grade ='';
			// if(score<60){
			// 	grade ='E'
			// }

			let ten = Math.trunc(score / 10); // 十位
			var grade = '';
			switch (ten) {
				case 10:
				case 9:
					grade = 'A';
					break;
				case 8:
					grade = 'B';
					break;
				case 7:
					grade = 'C';
					break;
				case 6:
					grade = 'D';
					break;
				case 5:
				case 4:
				case 3:
				case 2:
				case 1:
				case 0:
					grade = 'E';
					break;
				default:
					grade ="成绩有误，请检查";
				
			}

			console.log("ten:" + ten)
			console.log("score:" + score)
			console.log("grade:" + grade)
		</script>
	</head>
	<body>
	</body>
</html>
